home *** CD-ROM | disk | FTP | other *** search
- ' This BasicCAD program determines the status of layers within a DesignCAD drawing.
- '
- ' It uses a simple for/next loop to iterate through the first 10 layers, (1-10, not zero).
- ' On each layer it uses integer division to determine the layer's status, then displays
- ' a message with the results. If that layer is named, the name is also returned.
- '
- ' Since SYS$93 returns the name of the current layer, the origional current layer number
- ' must be stored before the loop starts, and reset once we're done.
- '
- ' Change the value of the variable Count to make the program work with more or less layers.
- '
- Precision 0
- Count = 10
- ' Get the Current Layer Before Starting the Loop
- Current = Sys(3)
- '
- ' Loop for Layers 1-10
- for a = 1 to Count
- ' Set the Current Layer to a
- Sys(3) = a
- ' Setup Default Values
- visible$ = "not visible"
- edt$ = "not editable"
- ent$ = "contains no entities"
- Y=LAYER(a) ' Returns 0-15
- if ODD(Y\2)=1 then ' Layer is visible, Results 2, 3, 6, 7, 14, or 15
- visible$ = "visible"
- endif
- if ODD(y\4)=1 then ' Layer is Editable, Results 6, 7, 14, or 15
- edt$ = "editable"
- endif
- if ODD(y)=1 then ' Layer Contains Entities, Results 1, 3, 7, or 15
- ent$ = "contains entities"
- endif
- ' Check for Layer Name
- if SYS$(93) = "" then
- name$ = "and has no name assigned."
- else
- name$ = "and is named",Sys$(93),"."
- endif
- ' Display Results
- Message "Layer ",a," is",visible$,",",edt$,",",ent$,",",name$
- if a = Current then
- Message "Layer ",a," is also the Current Layer . . ."
- endif
- ' Done with this layer, get the next one, loop back to the For statement
- next a
- ' Done with all Layers in Count
- Message "Done. ",Count," Layers Checked."
- ' Set current Layer back to origional value
- Sys(3) = Current
- End
-